import NamedString from "@/models/core/NamedString";
import {OpObjType} from "@/models/domain/OpObjType";
import {NextStepType} from "@/models/domain/NextStepType";
import Check from "@/models/dto/ctl/Check";
import StepObjectValue from "@/models/dto/ctl/StepObjectValue";
import StepPointValue from "@/models/dto/ctl/StepPointValue";
import {Type} from "class-transformer";

export default class Step extends NamedString {
    public jobId?: string;
    public execType: OpObjType = OpObjType.point;
    public execJobId?: string;
    public execValue?: number;

    public onSuccId: string = NextStepType.nextStep;
    public onFailId: string = NextStepType.exitFailed;

    @Type(() => Check)
    public preCheck?: Check;
    @Type(() => Check)
    public postCheck?: Check;
    public postCheckDelay?: number | string;
    public postRetries?: number | string;

    @Type(() => StepObjectValue)
    public objects: StepObjectValue[] = [];
    @Type(() => StepPointValue)
    public points: StepPointValue[] = [];

    public orderNo: number = 0;
}